﻿using System;
using System.Collections.Generic;
using System.Dto;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.IBLL
{
    public interface IHouseholdManager
    {
        /// <summary>
        /// 住户表table数据获取
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="UserName">用户名筛选</param>
        /// <param name="PhoneNumber">电话筛选</param>
        /// <param name="sex">性别</param>
        /// <param name="datalet">数据总条数</param>
        /// <returns></returns>
        List<HouseHoldList> GetHouseholdLists(int limit, int page, string UserName, string PhoneNumber, string sex, out int datalet);
        /// <summary>
        /// 通过住户ID获取到住户房屋信息
        /// </summary>
        /// <param name="id">住户id</param>
        /// <returns></returns>
        string GetStoreyById(int id); 
        /// <summary>
        /// 住户添加页面的tableSelect下拉框数据请求接口
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="StoreyName">房间号筛选</param>
        /// <param name="datalet">数据总长度</param>
        /// <returns></returns>
        List<GetTableSelectStoreyListDto> GettableSelectStoreyList(int limit, int page, string StoreyName, out int datalet);
        /// <summary>
        /// 添加住户信息
        /// </summary>
        /// <param name="UserName">住户名</param>
        /// <param name="PassWord">密码</param>
        /// <param name="Sex">住户性别</param>
        /// <returns></returns>
        Task AddNewOneHouseholdAsync(string UserName, string PassWord, string Sex);
        /// <summary>
        /// 通过住户名及createtime倒序获取到最新的住户对应的ID
        /// </summary>
        /// <param name="UserName">住户名</param>
        /// <returns></returns>
        int GetOneHouseholdIdByUserName(string UserName);
        /// <summary>
        /// 向HouseholdToStorey添加对应的住户居住信息
        /// </summary>
        /// <param name="houseId">住户ID</param>
        /// <param name="storeyId">楼房ID</param>
        /// <param name="isOwner">是否是房主</param>
        /// <returns></returns>
        Task AddHouseholdToStorey(int houseId, string storeyId, string isOwner);
        /// <summary>
        /// 通过住户ID删除住户信息，伪删除
        /// </summary>
        /// <param name="id">住户ID</param>
        /// <returns></returns>
        Task DelHouseholdById(int id);
        /// <summary>
        /// 通过住户ID查询其在HouseholdToStorey表中关联数据的ID然后进行伪删除
        /// </summary>
        /// <param name="id">住户ID</param>
        /// <returns></returns>
        Task DelHouseholdToStoreyById(int id);
        /// <summary>
        /// 通过住户ID获取到住户信息
        /// </summary>
        /// <param name="id">住户ID</param>
        /// <returns></returns>
        HouseHoldList GetOneHouseholdById(int id);
        /// <summary>
        /// 通过住户ID获取到数据库中对应的住户信息并进行修改
        /// </summary>
        /// <param name="houseHoldList">数据模型，内含ID</param>
        /// <returns></returns>
        Task EditOneHouseholdByDto(HouseHoldList houseHoldList);
        /// <summary>
        /// 通过住户ID获取其在HouseholdToStorey表中关联的数据ID，然后进行修改
        /// </summary>
        /// <param name="id">住户ID</param>
        /// <param name="isOwner">是否房主</param>
        /// <returns></returns>
        Task EditOneHouseholdToStorey(int id,string isOwner);

        /// <summary>
        /// 获取到临时进出表的数据
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="ApplicationName">申请人筛选</param>
        /// <param name="datalet">数据总条数</param>
        /// <returns></returns>
        List<GetTemporaryAccessList> GetTemporaryAccessLists(int limit, int page, string ApplicationName, out int datalet);
        /// <summary>
        /// 临时进出审核接口
        /// </summary>
        /// <param name="id">申请ID</param>
        /// <param name="examineResult">审核结果</param>
        /// <param name="examineName">审核人</param>
        /// <returns></returns>
        Task ExamineOneTemporaryAccessById(string applicationName,string accessReason,string url, string remark, string guid);
        string GetNewOneTemporaryAccessByName(string applicationName);

        Task CheangTimeByPass(string pass, bool isout);
        GetTemporaryAccessList getOneAccessByPass(string pass);

        List<GetActivityReleaseListDto> GetMyActivityLists(int userId, int limit, int page, string activityName, out int datalet);
        ActivityRegistrationDto GetOneActivityById(int id);
        Task EditOneAcivityByDto(ActivityRegistrationDto dto);

        List<GetMessageListDto> getMyMessageListByDtos(int userId, int limit, int page, string messageText, out int datalet);

        Task DelMyOneMessageById(int id);
    }
}
